package com.zrgk.service;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zrgk.bean.OrderBean;
import com.zrgk.dao.OrderDao;
import com.zrgk.util.PageUtil;
@Service("orderService")
public class OrderServiceImpl implements OrderService{
	@Autowired
	@Qualifier("orderDao")
	private OrderDao orderDao;
	public void insertOrder(OrderBean order, String[] goodsIds) {
		// TODO Auto-generated method stub
		
	}

	public PageUtil queryByPage(PageUtil pu) {
		
		Map<String, String> map = pu.getSearchInfo();
		Page<Object> sPage = PageHelper.startPage(pu.getNowPage(), pu.getPageSize());
		pu.setList(orderDao.queryAll(map));
		Long totalCount = sPage.getTotal();
		pu.setTotalCount(totalCount.intValue());
		pu.setTotalPage(sPage.getPageNum());
		return pu;
	}

}
